home *** CD-ROM | disk | FTP | other *** search
/ Star Trek Starfleet Academy Mini Omnipedia / MINI_OMNI.ISO / pc / omni_v2.dxr / 00385_MIAW handlers for PICTs and VIDEO.ls < prev    next >
Encoding:
Text File  |  1996-04-15  |  8.3 KB  |  298 lines

  1. global gMyWinList, gTheWindowRect, gMyQTwindow, gQTWinActive, gwinCheck, gWinListNum, gTheName, gTheNewWinht, gTheNewWinwd, gMyWinTracker, gMyWindow, gtheLockList, gImageList, gthumbn1spr, gthumbn2spr, gthumbn3spr, gthumbn4spr, gthumbn5spr, gVideoName, gPDL, gtheWord, gWinType, gNewCaption, gCaptionList, gAssetPath, gComputerTypeK, gthumbholdcst, gTrekCursor, oWinKey, gModeState, gActiveResTopWin, gActiveTopWin, gMacColorIsHere, gWinTypeList, gActiveWin, glinktostagemsg, gLockWinStorage, oPWin, gVidIsPlaying, gWinOffSet, gLastWinLeft, gLastWinTop, gSpriteList, gWinLocRootT, gWinLocRootL, gWinLocCounter, gLastResWinLeft, gLastResWinTop
  2.  
  3. on hInitMinaWLists
  4.   set gWinListNum to 0
  5.   set gMyWinList to [:]
  6.   set gMyWinTracker to [:]
  7.   set gtheLockList to [:]
  8.   set gImageList to [:]
  9.   set gWinTypeList to [:]
  10.   set gSpriteList to [:]
  11.   set the windowList to []
  12.   set gVidIsPlaying to 0
  13.   set gWinOffSet to 6
  14.   set gLockWinStorage to []
  15.   set gLastWinLeft to the stageLeft + 330
  16.   set gLastWinTop to the stageTop + 172
  17.   set gLastResWinLeft to the stageLeft + 160
  18.   set gLastResWinTop to the stageTop + 200
  19.   set gWinLocRootL to gLastWinLeft
  20.   set gWinLocRootT to gLastWinTop
  21.   set gWinLocCounter to 1
  22.   set the fileName of cast the number of cast "BlankM.DIR" to the pathName & "BL" & gPDL & "BlankM.DIR"
  23.   repeat with n = 1 to 15
  24.     addProp(gMyWinList, n, EMPTY)
  25.     addProp(gImageList, n, EMPTY)
  26.     addProp(gWinTypeList, n, #CLOSED)
  27.     addProp(gMyWinTracker, n, 0)
  28.     addProp(gtheLockList, n, 0)
  29.     addProp(gSpriteList, n, 0)
  30.   end repeat
  31.   if gComputerTypeK = #WIN then
  32.     set gWinType to 49
  33.   else
  34.     set gWinType to 16
  35.   end if
  36. end
  37.  
  38. on hHelpWinClose
  39.   repeat with a = 1 to 15
  40.     if getaProp(gtheLockList, a) = 0 then
  41.       set vWinToLose to string(getaProp(gMyWinList, a))
  42.       if gActiveResTopWin = vWinToLose then
  43.         hCloseTopWin()
  44.       end if
  45.       forget(window vWinToLose)
  46.       setAt(gMyWinTracker, a, 0)
  47.       setAt(gMyWinList, a, EMPTY)
  48.       setAt(gImageList, a, EMPTY)
  49.       setAt(gWinTypeList, a, #CLOSED)
  50.     end if
  51.     hClearTopic()
  52.   end repeat
  53. end
  54.  
  55. on hUpdateWin
  56.   repeat with a = 1 to 15
  57.     if getaProp(gtheLockList, a) = 0 then
  58.       set vWinToLose to string(getaProp(gMyWinList, a))
  59.       if gActiveResTopWin = vWinToLose then
  60.         hCloseTopWin()
  61.       end if
  62.       forget(window vWinToLose)
  63.       setAt(gMyWinTracker, a, 0)
  64.       setAt(gMyWinList, a, EMPTY)
  65.       setAt(gImageList, a, EMPTY)
  66.       setAt(gWinTypeList, a, #CLOSED)
  67.     end if
  68.   end repeat
  69.   hClearPicons()
  70.   hClearTopic()
  71. end
  72.  
  73. on hClearPicons
  74.   set the visible of sprite gthumbn1spr to 1
  75.   set the visible of sprite gthumbn2spr to 1
  76.   set the visible of sprite gthumbn3spr to 1
  77.   set the visible of sprite gthumbn4spr to 1
  78.   set the visible of sprite gthumbn5spr to 1
  79. end
  80.  
  81. on hHidePicons
  82.   repeat with x = gthumbn1spr to gthumbn5spr
  83.     set the visible of sprite x to 0
  84.   end repeat
  85. end
  86.  
  87. on hClearTopic
  88.   if gModeState <> #TOPICS then
  89.     if not voidp(gActiveResTopWin) then
  90.       forget(window string(gActiveResTopWin))
  91.     end if
  92.   end if
  93. end
  94.  
  95. on hClearResourseMiaw
  96.   if not voidp(gActiveResTopWin) then
  97.     forget(window string(gActiveResTopWin))
  98.   end if
  99. end
  100.  
  101. on hStoreLockWins
  102.   set gLockWinStorage to []
  103.   set vPriorLeft to 1600
  104.   set vPriorTop to 1600
  105.   repeat with a = 1 to 15
  106.     if getaProp(gtheLockList, a) = 1 then
  107.       set vWinToLose to string(getaProp(gMyWinList, a))
  108.       add(gLockWinStorage, getAt(gImageList, a))
  109.       set vWinRect to the rect of window vWinToLose
  110.       put vWinRect
  111.       if getAt(vWinRect, 1) < vPriorLeft then
  112.         set vPriorLeft to getAt(vWinRect, 1)
  113.         set vPriorTop to getAt(vWinRect, 2)
  114.       end if
  115.       tell window vWinToLose
  116.         mDoCloseWindow(oPWin)
  117.       end tell
  118.       setAt(gtheLockList, a, 0)
  119.       setAt(gMyWinTracker, a, 0)
  120.       setAt(gMyWinList, a, EMPTY)
  121.       setAt(gImageList, a, EMPTY)
  122.       setAt(gWinTypeList, a, #CLOSED)
  123.     end if
  124.   end repeat
  125.   if vPriorLeft < 1600 then
  126.     set gLastWinLeft to vPriorLeft
  127.     set gLastWinTop to vPriorTop
  128.   end if
  129. end
  130.  
  131. on hRestoreLockWins
  132.   set x to count(gLockWinStorage)
  133.   if x then
  134.     repeat with vWinNum = 1 to x
  135.       hOpenLockWin(getAt(gLockWinStorage, vWinNum))
  136.       setAt(gtheLockList, gWinListNum, 1)
  137.     end repeat
  138.   end if
  139.   hHideOpenPicons()
  140.   repeat with vWinNum = 1 to x
  141.     tell window getAt(gMyWinList, vWinNum)
  142.       mForceLockMe(oPWin)
  143.     end tell
  144.   end repeat
  145.   set gLockWinStorage to []
  146. end
  147.  
  148. on hOpenLockWin pPictName
  149.   hSysAlert(#MEDIALINK)
  150.   set gTheName to pPictName
  151.   hGetPICTWinNum()
  152.   hgetCaption()
  153.   if getAt(gMyWinTracker, gWinListNum) = 0 then
  154.     if (gWinListNum > 0) and (gWinListNum < 11) then
  155.       hActivateMIAW(the pathName & "BL" & gPDL & gWinListNum & "PicWn.dir", gWinListNum)
  156.     end if
  157.     set vNewWinName to getAt(gMyWinList, gWinListNum)
  158.     open(window vNewWinName)
  159.     hCallOmniColor()
  160.     moveToFront(window vNewWinName)
  161.     tell window vNewWinName
  162.       mStartUp(oPWin)
  163.     end tell
  164.     tell window vNewWinName
  165.       mForceLockMe(oPWin)
  166.     end tell
  167.     tell window vNewWinName
  168.       mSetbasicWinKeys(oWinKey, window vNewWinName)
  169.     end tell
  170.     tell window vNewWinName
  171.       mSetBasicMouseUp(oWinKey, window vNewWinName)
  172.     end tell
  173.     set gLastWinLeft to getAt(the rect of window vNewWinName, 1) + gWinOffSet
  174.     set gLastWinTop to getAt(the rect of window vNewWinName, 2) + gWinOffSet
  175.   end if
  176. end
  177.  
  178. on hOpenPict pMySprite
  179.   global oVidCD
  180.   if the castNum of sprite pMySprite <> gthumbholdcst then
  181.     if mCheckForHomeCD(oVidCD, "hOpenPict " & string(pMySprite)) then
  182.       hSysAlert(#MEDIALINK)
  183.       hOpenWhichImage(pMySprite)
  184.       hGetPICTWinNum()
  185.       setAt(gSpriteList, gWinListNum, pMySprite)
  186.       set the visible of sprite pMySprite to 0
  187.       updateStage()
  188.       hgetCaption()
  189.       if getAt(gMyWinTracker, gWinListNum) = 0 then
  190.         if (gWinListNum > 0) and (gWinListNum < 11) then
  191.           hActivateMIAW(the pathName & "BL" & gPDL & gWinListNum & "PicWn.dir", gWinListNum)
  192.         end if
  193.         set vNewWinName to getAt(gMyWinList, gWinListNum)
  194.         open(window vNewWinName)
  195.         hCallOmniColor()
  196.         moveToFront(window vNewWinName)
  197.         tell window vNewWinName
  198.           mStartUp(oPWin)
  199.         end tell
  200.         tell window vNewWinName
  201.           mSetbasicWinKeys(oWinKey, window vNewWinName)
  202.         end tell
  203.         tell window vNewWinName
  204.           mSetBasicMouseUp(oWinKey, window vNewWinName)
  205.         end tell
  206.         set gLastWinLeft to getAt(the rect of window vNewWinName, 1) + gWinOffSet
  207.         set gLastWinTop to getAt(the rect of window vNewWinName, 2) + gWinOffSet
  208.         hCheckWinLocCounter()
  209.       end if
  210.     end if
  211.   end if
  212. end
  213.  
  214. on hOpenWhichImage pMySprite
  215.   set Lmynum to the castNum of sprite pMySprite
  216.   if Lmynum = gthumbholdcst then
  217.     abort()
  218.   end if
  219.   set zz to the name of cast Lmynum
  220.   set gTheName to chars(string(zz), 1, 7)
  221.   repeat with y = 1 to 10
  222.     if getaProp(gImageList, y) = gTheName then
  223.       beep()
  224.       abort()
  225.     end if
  226.   end repeat
  227. end
  228.  
  229. on hOpenWhichResImage pImageName
  230.   set gTheName to chars(pImageName, 1, 7)
  231.   set vIsNewImage to 1
  232.   if getOne(gImageList, gTheName) then
  233.     set vIsNewImage to 0
  234.     set glinktostagemsg to EMPTY
  235.     abort()
  236.   end if
  237.   return vIsNewImage
  238. end
  239.  
  240. on hGetPICTWinNum
  241.   repeat with a = 1 to 10
  242.     if getaProp(gMyWinTracker, a) = 1 then
  243.       if a = 10 then
  244.         hAnnounce("Max Num. Images open...")
  245.         abort()
  246.       end if
  247.       next repeat
  248.     end if
  249.     set gWinListNum to a
  250.     exit repeat
  251.   end repeat
  252. end
  253.  
  254. on hOpenVideo
  255.   hSysAlert(#MEDIALINK)
  256.   hOpenWhichVid()
  257.   hGetVidWinNum()
  258.   hGetVidCap()
  259.   if (gWinListNum > 10) and (gWinListNum < 16) then
  260.     if gComputerTypeK = #WIN then
  261.       hActivateMIAW(the pathName & "BL" & gPDL & gWinListNum & "VIDWNW.DIR", gWinListNum)
  262.     else
  263.       hActivateMIAW(the pathName & "BL" & gPDL & gWinListNum & "VidWn.dir", gWinListNum)
  264.     end if
  265.   end if
  266.   set vNewWinName to getAt(gMyWinList, gWinListNum)
  267.   open(window vNewWinName)
  268.   hCallOmniColor()
  269.   moveToFront(window vNewWinName)
  270.   tell window vNewWinName
  271.     mSetbasicWinKeys(oWinKey, window vNewWinName)
  272.   end tell
  273.   tell window vNewWinName
  274.     mSetBasicMouseUp(oWinKey, window vNewWinName)
  275.   end tell
  276. end
  277.  
  278. on hOpenWhichVid
  279.   global gNopeSND
  280.   set gTheName to gVideoName
  281.   set y to 11
  282.   if getaProp(gImageList, y) = gTheName then
  283.     hearit(gNopeSND)
  284.     abort()
  285.   end if
  286. end
  287.  
  288. on hGetVidWinNum
  289.   global gNopeSND
  290.   set a to 11
  291.   if getaProp(gMyWinTracker, a) = 1 then
  292.     hearit(gNopeSND)
  293.     abort()
  294.   else
  295.     set gWinListNum to a
  296.   end if
  297. end
  298.